package com.bnq.control.common.factory;

import android.content.Context;

import com.bnq.control.common.interfaces.IStoragePath;
import com.bnq.control.common.utils.BuildConfig;


/**
 * 管理存储工厂
 */
public class StorageFactoryManager implements IStoragePath {
    /**
     * 构建单利对象
     */
    public static StorageFactoryManager getInstance() {
        return Holder.INSTANCE;
    }

    /**
     * 静态内部类
     */
    private static class Holder {
        private static final StorageFactoryManager INSTANCE = new StorageFactoryManager();
    }

    @Override
    public String getStoragePath(Context context, String filePath) {
        if (BuildConfig.hasQ())
            return StorageAndroidQFactory.getInstance().getStoragePath(context, filePath);
        return StorageAndroidExternalFactory.getInstance().getStoragePath(context, filePath);
    }
}
